package com.ourteam.product.model.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Tue Nov 07 10:29:34 IRKT 2017
 * Auto Generate Date : 2017-11-15 14:51:11
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class ProductModelDomainBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.product.model.dao.IProductModelDomainDAO.Id);

        mappedDaoFields.put("domainCode",
            com.ourteam.product.model.dao.IProductModelDomainDAO.DomainCode);

        mappedDaoFields.put("domainName",
            com.ourteam.product.model.dao.IProductModelDomainDAO.DomainName);

        mappedDaoFields.put("status",
            com.ourteam.product.model.dao.IProductModelDomainDAO.Status);

        mappedDaoFields.put("remarks",
            com.ourteam.product.model.dao.IProductModelDomainDAO.Remarks);

        mappedDaoFields.put("submitterId",
            com.ourteam.product.model.dao.IProductModelDomainDAO.SubmitterId);

        mappedDaoFields.put("creatorName",
            com.ourteam.product.model.dao.IProductModelDomainDAO.CreatorName);

        mappedDaoFields.put("createTime",
            com.ourteam.product.model.dao.IProductModelDomainDAO.CreateTime);

        mappedDaoFields.put("lastModifierName",
            com.ourteam.product.model.dao.IProductModelDomainDAO.LastModifierName);

        mappedDaoFields.put("lastModifyTime",
            com.ourteam.product.model.dao.IProductModelDomainDAO.LastModifyTime);
    }

    private com.ourteam.product.model.dao.ProductModelDomain productModelDomain;

    public ProductModelDomainBean() {
        super();

        this.productModelDomain = new com.ourteam.product.model.dao.ProductModelDomain();
    }

    public ProductModelDomainBean(
        com.ourteam.product.model.dao.ProductModelDomain productModelDomain) {
        super();

        this.productModelDomain = productModelDomain;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(productModelDomain);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.product.model.dao.ProductModelDomain convertToProductModelDomain() {
        return this.productModelDomain;
    }

    public com.ourteam.product.model.dao.ProductModelDomain convertTo() {
        return this.productModelDomain;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.productModelDomain.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.productModelDomain.setId(id);
    }

    /**
     * Get domainCode
     *
     * @return String
     */
    public String getDomainCode() {
        return (String) this.productModelDomain.getDomainCode();
    }

    /**
     * Set domainCode
     *
     * @parameter String
     */
    public void setDomainCode(String domainCode) {
        this.productModelDomain.setDomainCode(domainCode);
    }

    /**
     * Get domainName
     *
     * @return String
     */
    public String getDomainName() {
        return (String) this.productModelDomain.getDomainName();
    }

    /**
     * Set domainName
     *
     * @parameter String
     */
    public void setDomainName(String domainName) {
        this.productModelDomain.setDomainName(domainName);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.productModelDomain.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.productModelDomain.setStatus(status);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.productModelDomain.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.productModelDomain.setRemarks(remarks);
    }

    /**
     * Get submitterId
     *
     * @return long
     */
    public long getSubmitterId() {
        return (long) this.productModelDomain.getSubmitterId();
    }

    /**
     * Set submitterId
     *
     * @parameter long
     */
    public void setSubmitterId(long submitterId) {
        this.productModelDomain.setSubmitterId(submitterId);
    }

    /**
     * Get creatorName
     *
     * @return String
     */
    public String getCreatorName() {
        return (String) this.productModelDomain.getCreatorName();
    }

    /**
     * Set creatorName
     *
     * @parameter String
     */
    public void setCreatorName(String creatorName) {
        this.productModelDomain.setCreatorName(creatorName);
    }

    /**
     * Get createTime
     *
     * @return java.util.Date
     */
    public java.util.Date getCreateTime() {
        return (java.util.Date) this.productModelDomain.getCreateTime();
    }

    /**
     * Set createTime
     *
     * @parameter java.util.Date
     */
    public void setCreateTime(java.util.Date createTime) {
        this.productModelDomain.setCreateTime(createTime);
    }

    /**
     * Get lastModifierName
     *
     * @return String
     */
    public String getLastModifierName() {
        return (String) this.productModelDomain.getLastModifierName();
    }

    /**
     * Set lastModifierName
     *
     * @parameter String
     */
    public void setLastModifierName(String lastModifierName) {
        this.productModelDomain.setLastModifierName(lastModifierName);
    }

    /**
     * Get lastModifyTime
     *
     * @return java.util.Date
     */
    public java.util.Date getLastModifyTime() {
        return (java.util.Date) this.productModelDomain.getLastModifyTime();
    }

    /**
     * Set lastModifyTime
     *
     * @parameter java.util.Date
     */
    public void setLastModifyTime(java.util.Date lastModifyTime) {
        this.productModelDomain.setLastModifyTime(lastModifyTime);
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof ProductModelDomainBean) == false) {
            return false;
        } // end if

        ProductModelDomainBean other = (ProductModelDomainBean) obj;

        boolean isEqual = false;

        com.ourteam.product.model.dao.ProductModelDomain tempProductModelDomain = other.convertToProductModelDomain();

        if ((tempProductModelDomain == null) ||
                (this.productModelDomain == null)) {
            isEqual = false;
        } else if ((tempProductModelDomain == this.productModelDomain) ||
                tempProductModelDomain.equals(this.productModelDomain)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static ProductModelDomainBean[] toArray(
        com.ourteam.product.model.dao.ProductModelDomain[] aProductModelDomains) {
        return toArray(aProductModelDomains, null);
    }

    public static ProductModelDomainBean[] toArray(
        com.ourteam.product.model.dao.ProductModelDomain[] aProductModelDomains,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aProductModelDomains)) {
            return new ProductModelDomainBean[0];
        }

        int length = aProductModelDomains.length;

        ProductModelDomainBean[] beans = new ProductModelDomainBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new ProductModelDomainBean(aProductModelDomains[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aProductModelDomains[i] });
            }
        }

        return beans;
    }
}
